package com.atguigu.crowd.mvc.handler;

import org.springframework.stereotype.Controller;

@Controller
public class TestHandler {
    /*Logger log = LoggerFactory.getLogger(TestHandler.class);
    @Autowired
    private AdminService adminService;
    @RequestMapping(value = "/test/ssm.html")
    public String testSsm(ModelMap modelMap, HttpServletRequest httpServletRequest) {
        int a = 10 / 0;
        log.info("测试1" + String.valueOf(CrowUtil.judgeRequestType(httpServletRequest)));
        List<Admin> adminList = adminService.getAll();
        modelMap.addAttribute("adminList", adminList);
        return "target";
    }




    @ResponseBody
    @RequestMapping(value = "/sent/arrayOne.html")
    public String testAjaResponsOne(@RequestParam("array[]")List<Integer> array) {
        for (int number : array) {
            log.debug("输出" + number);
        }
        return "success";
    }

    @ResponseBody
    @RequestMapping(value = "/sent/arrayTwo.html")
    public String testAjaResponsTwo(@RequestBody Integer[] array) {
        for (int number : array) {
            log.info("此次输出：" + number);
        }
        return "testTwo";
    }

    @ResponseBody
    @RequestMapping(value = "/sent/arrayThree.json")
    public ResultEntity<Student> testAjaxResponsThree(@RequestBody Student student, HttpServletRequest httpServletRequest) {
        log.info("测试2" + String.valueOf(CrowUtil.judgeRequestType(httpServletRequest)));
        int a = 10 / 0;
        log.info(student.toString());
        return ResultEntity.successWithData(student);
    }*/


}
